package homework.xuluoxi;

/*
 * 作业名称：实体类和接口 - 卡类
 * 作业功能：实现实体类和接口
 * 学    员：徐罗希
 * 版    本：V1.0
 * 备    注：模块二作业
 */

public class Card {
    // 定义成员变量
    private CardTypeEnum type;
    private String number;
    private String userName;
    private String password;
    private double accountBalance;
    private int talkTime;
    private double netFlow;

    // 构造方法
    public Card() {};
    public Card(CardTypeEnum type, String number, String userName, String password, double accountBalance, int talkTime, double netFlow) {
        setType(type);
        setNumber(number);
        setUserName(userName);
        setPassword(password);
        setAccountBalance(accountBalance);
        setTalkTime(talkTime);
        setNetFlow(netFlow);
    }

    // get、set方法
    public CardTypeEnum getType() {
        return type;
    }
    public void setType(CardTypeEnum type) {
        this.type = type;
    }
    public String getNumber() {
        return number;
    }
    public void setNumber(String number) {
        this.number = number;
    }
    public String getUserName() {
        return userName;
    }
    public void setUserName(String userName) {
        this.userName = userName;
    }
    public String getPassword() {
        return password;
    }
    public void setPassword(String password) {
        this.password = password;
    }
    public double getAccountBalance() {
        return accountBalance;
    }
    public void setAccountBalance(double accountBalance) {
        this.accountBalance = accountBalance;
    }
    public int getTalkTime() {
        return talkTime;
    }
    public void setTalkTime(int talkTime) {
        this.talkTime = talkTime;
    }
    public double getNetFlow() {
        return netFlow;
    }
    public void setNetFlow(double netFlow) {
        this.netFlow = netFlow;
    }

    // 成员方法
    public void show() {
        System.out.println("您的卡号是：" + getNumber() + "，用户名是：" + getUserName() + "，账户余额是：" + getAccountBalance());
    }
}
